package com.sand.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "house", schema = "ssh_pro", catalog = "")
public class HouseEntity {
/**
 *
 *
 * @author <achao1441470436@gmail.com>
 * @since 2021/12/1/001 9:46
 */
    private int rid;
    private String buildingType;
    private int constructionArea;
    private Long price;
    private String rentalType;
    private int paymentMethod;
    private String renovationCondition;
    private String houseType;
    private String floorSituation;
    private String towards;
    private String housingConfiguration;
    private Timestamp createTime;
    private String houseDescribe;
    private int communityId;
    private int userId;

    @Id
    @GeneratedValue(generator = "house")
    @GenericGenerator(name = "house", strategy = "native")
    @Column(name = "rid")
    public int getRid() {
        return rid;
    }

    public void setRid(int rid) {
        this.rid = rid;
    }

    @Basic
    @Column(name = "buildingType")
    public String getBuildingType() {
        return buildingType;
    }

    public void setBuildingType(String buildingType) {
        this.buildingType = buildingType;
    }

    @Basic
    @Column(name = "constructionArea")
    public int getConstructionArea() {
        return constructionArea;
    }

    public void setConstructionArea(int constructionArea) {
        this.constructionArea = constructionArea;
    }

    @Basic
    @Column(name = "price")
    public Long getPrice() {
        return price;
    }

    public void setPrice(Long price) {
        this.price = price;
    }

    @Basic
    @Column(name = "rentalType")
    public String getRentalType() {
        return rentalType;
    }

    public void setRentalType(String rentalType) {
        this.rentalType = rentalType;
    }

    @Basic
    @Column(name = "paymentMethod")
    public int getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(int paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    @Basic
    @Column(name = "renovationCondition")
    public String getRenovationCondition() {
        return renovationCondition;
    }

    public void setRenovationCondition(String renovationCondition) {
        this.renovationCondition = renovationCondition;
    }

    @Basic
    @Column(name = "houseType")
    public String getHouseType() {
        return houseType;
    }

    public void setHouseType(String houseType) {
        this.houseType = houseType;
    }

    @Basic
    @Column(name = "floorSituation")
    public String getFloorSituation() {
        return floorSituation;
    }

    public void setFloorSituation(String floorSituation) {
        this.floorSituation = floorSituation;
    }

    @Basic
    @Column(name = "towards")
    public String getTowards() {
        return towards;
    }

    public void setTowards(String towards) {
        this.towards = towards;
    }

    @Basic
    @Column(name = "housingConfiguration")
    public String getHousingConfiguration() {
        return housingConfiguration;
    }

    public void setHousingConfiguration(String housingConfiguration) {
        this.housingConfiguration = housingConfiguration;
    }

    @Basic
    @Column(name = "createTime")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "houseDescribe")
    public String getHouseDescribe() {
        return houseDescribe;
    }

    public void setHouseDescribe(String houseDescribe) {
        this.houseDescribe = houseDescribe;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        HouseEntity that = (HouseEntity) o;
        return rid == that.rid && constructionArea == that.constructionArea && Objects.equals(buildingType, that.buildingType) && Objects.equals(price, that.price) && Objects.equals(rentalType, that.rentalType) && Objects.equals(paymentMethod, that.paymentMethod) && Objects.equals(renovationCondition, that.renovationCondition) && Objects.equals(houseType, that.houseType) && Objects.equals(floorSituation, that.floorSituation) && Objects.equals(towards, that.towards) && Objects.equals(housingConfiguration, that.housingConfiguration) && Objects.equals(createTime, that.createTime) && Objects.equals(houseDescribe, that.houseDescribe);
    }

    @Override
    public int hashCode() {
        return Objects.hash(rid, buildingType, constructionArea, price, rentalType, paymentMethod, renovationCondition, houseType, floorSituation, towards, housingConfiguration, createTime, houseDescribe);
    }

    @Basic
    @Column(name = "communityId")
    public int getCommunityId() {
        return communityId;
    }

    public void setCommunityId(int communityId) {
        this.communityId = communityId;
    }

    @Basic
    @Column(name = "userId")
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }
}
